package org.xiaov.framework.component.properties;

import io.jsonwebtoken.SignatureAlgorithm;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * <p>
 * 描述：
 * </p>
 *
 * @author xiaovcloud
 * @since 2021/10/6 12:30
 */
@Component
@ConfigurationProperties(prefix = "v.token")
@Getter
@Setter
public class TokenProperties {
    /**
     * 过期时间
     */
    private Long expireTime = 300L;
    /**
     * 私钥
     */
    private String secretKey;
    /**
     * 签名算法，默认HS256
     */
    private SignatureAlgorithm signature = SignatureAlgorithm.HS256;

    public Long getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(Long expireTime) {
        this.expireTime = expireTime;
    }

    public String getSecretKey() {
        return secretKey;
    }

    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }

    public SignatureAlgorithm getSignature() {
        return signature;
    }

    public void setSignature(SignatureAlgorithm signature) {
        this.signature = signature;
    }
}
